package steampunk.io;
import java.io.*;

public class InstallManager {
	
	private static File INSTALL_DIR = null;
	
	// Initialization code
	static {
		//INSTALL_DIR = new File("/home/g/lib");
		INSTALL_DIR = new File(System.getProperty("user.home") + File.separator + "/.steampunk");
	}
	
	private static String seprep(String input) {
		StringBuffer sb = new StringBuffer(input.length());
		for (int i = 0; i < input.length(); i++) {
			char c = input.charAt(i);
			if (c == '/')
				sb.append(File.separator);
			else
				sb.append(c);
		}
		return sb.toString();
	}

	public static File getInstallDirectory() {
		return INSTALL_DIR;
	}
	
	public static File getFile(String fname) {
		return new File(INSTALL_DIR.getAbsolutePath() + File.separator + seprep(fname));
	}
}
